﻿using Microsoft.AspNetCore.Mvc.Controllers;
using Microsoft.AspNetCore.Mvc.Filters;
using Microsoft.OpenApi.Extensions;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using QiAdmin.Core.Models;
using QiAdmin.Core.Services.Cache;
using QiAdmin.Core.Services.Token;
using QiAdmin.Model.Dtos.Output;
using QiAdmin.Service.IService;

namespace QiAdmin.Core.Attributes
{
    public class ReadOnlyAttribute : ActionFilterAttribute
    {

        public ReadOnlyAttribute()
        {
        }
        public override void OnActionExecuting(ActionExecutingContext context)
        {
            context.HttpContext.Response.StatusCode = 403;
            context.Result = new ApiJsonResult(ResultType.Error, "演示环境，请不要进行这么危险的动作哦");

            base.OnActionExecuting(context);
        }
    }
}
